<template>
  <div class="tabber-item" @click="itemClick">
    <div :style="optionColor1">
      <slot name="item-text"></slot>
    </div>
    </div>
</template>

<script>

export default {
  name: 'TabBarItem',
  data() {
    return {
    }
  },
  props:{
    path:String,
    optionColor:{
      optionColor: String,
      default: "red"
    }
  },
  methods: {
    itemClick () {
      this.$router.push(this.path)
    }
  },
  computed: {
     isShow () {
      return this.$route.path.indexOf(this.path) !==-1
    },
    optionColor1 () {
      return this.isShow ? {color: this.optionColor} : {}
    }
  }
}
</script>

<style scoped>
  .tabber-item {
  flex: 1;
  text-align: center;
  height: 49px;
  line-height: 49px;
  font-size: 20px;
}
</style>>
